#!/bin/sh

workdir="/Users/hbaolong/workshop/gitee/3place"

fortunefile="/Users/hbaolong/workshop/gitee/3place/allmingju.md"

cd $workdir

sed -e "/^$/d" $fortunefile >tmp.md

allfortune=`wc tmp.md | awk '{print $1}'`

rannum=`echo $((RANDOM % $allfortune + 1))`

line=`echo $rannum"p"`

#echo "sed -n $line tmp.md"

sed -n $line tmp.md

#exec `sed -n $line tmp.md`

#exec `printf "sed -n %dp %s\n" $rannum tmp.md` 

rm -f tmp.md
